package fun.ui;

import java.util.Random;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.lex.awt.Location;

import fun.configuration.Config;

public class Fun extends JFrame {
	public static void main(String[] args) {
		Splash.setStatus("Starting...");
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				UIManager.put("swing.boldMetal", false);
				Config.loadConfigurationFromFile();
				final JFrame main = new FunMainFrame();
				Location.moveToScreenCenter(main);
				main.setVisible(true);
			}
		});
	}

	static void splashTest() {
		Random rand = new Random();
		for (int i = 0; i < Splash.MAX_PROGRESS; i++) {
			Splash.setStatus("Step " + i);
			try {
				Thread.sleep(rand.nextInt(2000) + 500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
